@function rem($px) {
  $remSize: $px/40;
  @return #{$remSize}rem;
}

// 常用样式
// flex 居中
@mixin flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

// 满屏背景图
@mixin height100-bg($url) {
  position: relative;
  height: 100%;
  background-image: url($url);
  background-size: cover;
}

@mixin bg-image($url) {
  background-image: url($url+"@2x.png");
  @media (-webkit-min-device-pixel-ratio: 3),(min-device-pixel-ratio:3) {
    background-image: url($url+"@3x.png");
  }
}

// 1px边框
@mixin border-1px($color) {
  position: relative;
  &::after {
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    border-bottom: 1px solid $color;
    content: '';
  }
}